package com.android.lpiquiz;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class LPIQuiz extends Activity
{
	
	LPIQuizActivity lpiQuizActivity;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        Button startQuizButton = (Button) findViewById(R.id.startQuizButton);
        Button optionQuizButton = (Button) findViewById(R.id.optionsButton);
        Button exitQuizButton = (Button) findViewById(R.id.exitButton);
        
        startQuizButton.setOnClickListener(new View.OnClickListener()
        {
        	public void onClick(View view)
        	{
            	Intent myIntent = new Intent(view.getContext(), LPIQuizActivity.class);
            	startActivityForResult(myIntent, 0);
        	}
        });
        
        optionQuizButton.setOnClickListener(new OnClickListener()
        {
            public void onClick(View v)
            {
                    Intent settingsActivity = new Intent(getBaseContext(),LPIQuizPreferences.class);
                    startActivity(settingsActivity);
            }
        });
        
        exitQuizButton.setOnClickListener(new View.OnClickListener()
        {
        	public void onClick(View view)
        	{
                Intent intent = new Intent();
                setResult(RESULT_OK, intent);
                finish();
        	}
        });

    }
}
